home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 March / EnigmA AMIGA RUN 05 (1996)(G.R. Edizioni)(IT)[!][issue 1996-03][Skylink CD IV].iso / earcd / util2 / createdi.lha / CreateDI / cinfo < prev    next >
Text File  |  1995-12-07  |  1KB  |  66 lines

  1. /*
  2.     $VER: CInfo V1.0 - Create Infofile for datafiles/drawer  (1995/12/07)
  3.  */
  4.  
  5.  
  6. Arg Dir Options
  7.     say
  8.     say 'CInfo V1.0 (Create Infofile for datafiles/drawers)'
  9.     say 'By christer.bjarnemo@mailbox.swipnet.se'
  10.     say ''
  11. If Dir = '?' | Dir = '/?' | Dir = '-?' | Dir = '' then signal Usage
  12.  
  13. if upper(Dir) = '-R' | upper(options) = '-R' then do
  14.     dir = ''
  15.     options = 'all'
  16. end
  17.  
  18. Address COMMAND 'list 'Dir' PAT ~(#?.info) FILES LFORMAT "%p%n" 'options' >t:CInfo.temp'
  19. Call Open(list,'t:CInfo.temp','R')
  20.  
  21. DO forever
  22.     Line = ReadLN(list)
  23.     File = line
  24.     if eof(list) then break
  25.     NewFile = File'.info'
  26.     If ~EXISTS(newfile) then do
  27.         say 'Creating 'newfile
  28.         address command 'copy env:sys/def_tool.info to 'newfile
  29.     end
  30.     else say '* Skipping 'newfile', file already exists...'
  31.  
  32. END
  33. Call Close(list)
  34.  
  35. Address COMMAND 'list 'Dir' PAT ~(#?.info) DIRS LFORMAT "%p%n" 'options' >t:CInfo.temp'
  36. Call Open(list,'t:CInfo.temp','R')
  37.  
  38. DO forever
  39.     Line = ReadLN(list)
  40.     File = line
  41.     if eof(list) then break
  42.     NewFile = File'.info'
  43.     If ~EXISTS(newfile) then do
  44.         say 'Creating 'newfile' (drawer)'
  45.         address command 'copy env:sys/def_drawer.info to 'newfile
  46.     end
  47.     else say '* Skipping 'newfile', file already exists...'
  48.  
  49. END
  50. Call Close(list)
  51.  
  52. Address COMMAND 'Delete >NIL: t:CInfo.temp'
  53.  
  54. say
  55. say 'Operation complete.'
  56. say
  57. EXIT
  58.  
  59. Usage:
  60. say 'Usage: CInfo <dir> [options]'
  61. say
  62. say 'Available options:'
  63. say '-r  Recursive'
  64. say
  65. EXIT
  66.